Skip to content

Add dev:gen-ext-test-matrix command#1133

Open
crazywhalecc wants to merge 52 commits intov3from
v3-docs/readme
Open

Add dev:gen-ext-test-matrix command#1133
crazywhalecc wants to merge 52 commits intov3from
v3-docs/readme

Conversation

@crazywhalecc
Copy link
Copy Markdown
Owner

What does this PR do?

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@crazywhalecc crazywhalecc added the need-test This PR has not been tested yet, cannot merge now label May 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

StaticPHP Test Bot

Detected: Extensions: ds, imap, intl, memcache, opentelemetry, swow, zlib | Libraries: brotli, bzip2, glfw, libcares, libedit, libiconv, libpng, libsodium, libssh2, libunistring, mpir, openssl, xz, zlib, zstd | Targets: curl
Active labels: none
Config: Linux x86_64 + Windows x86_64 + macOS arm64 | PHP 8.5 NTS

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces automation to generate an extension-build test matrix and to analyze PR changes/labels for driving CI test selection, while also improving download robustness and adjusting several package/build behaviors.

Changes:

  • Add dev:gen-ext-test-matrix and dev:test-bot commands, and wire them into the console app and CI workflow for label-gated extension test runs.
  • Add retry support to GitHub/cURL/git download paths and adjust binary extraction to support merging into the shared buildroot.
  • Update multiple package configs/build scripts (curl deps, zstd libs, assorted extension patches, docs updates, etc.).

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/StaticPHP/Runtime/Shell/DefaultShell.php Adds curl debug logging and git-clone retry support.
src/StaticPHP/Runtime/Executor/UnixCMakeExecutor.php Restricts framework-flag injection to macOS target builds.
src/StaticPHP/Package/PackageInstaller.php Fixes install-state fallback behavior for target packages.
src/StaticPHP/ConsoleApplication.php Registers new dev commands in the CLI app.
src/StaticPHP/Command/Dev/TestBotCommand.php New command: analyzes PR files/labels and outputs bot metadata JSON.
src/StaticPHP/Command/Dev/GenExtTestMatrixCommand.php New command: generates GHA matrix entries for extension testing.
src/StaticPHP/Artifact/DownloaderOptions.php Adds -i short option for --ignore-cache.
src/StaticPHP/Artifact/Downloader/Type/GitHubTarball.php Threads retry count through GitHub tarball API/HEAD calls and downloads.
src/StaticPHP/Artifact/Downloader/Type/GitHubRelease.php Threads retry count through GitHub release API calls.
src/StaticPHP/Artifact/Downloader/Type/Git.php Passes retry count into git clone operations.
src/StaticPHP/Artifact/ArtifactExtractor.php Adds “merge” extraction mode when extracting into shared buildroot.
src/Package/Target/php/windows.php Simplifies Windows micro build flow (removes phar patch wrapper).
src/Package/Target/php/unix.php Simplifies Unix micro build flow (removes phar patch wrapper).
src/Package/Library/zstd.php Adds an additional Windows lib alias output (libzstd.lib).
src/Package/Library/mpir.php Pins WindowsTargetPlatformVersion in msbuild invocation.
src/Package/Extension/zlib.php Adjusts zlib configure args based on PHP version + spx presence.
src/Package/Extension/opentelemetry.php Adds toolchain-aware warning suppression flags.
src/Package/Extension/memcache.php Adds PHP 8.5 header path patching for smart_string headers.
src/Package/Extension/intl.php Extends Windows intl patching to enforce C++17 for ICU 73+.
src/Package/Extension/imap.php Adds a PHP 8.2 compatibility patch for imap source.
src/Package/Artifact/go_xcaddy.php Adds retries for Go version/page fetches.
src/Package/Artifact/go_win.php Adds retries for Go version/page fetches.
docs/zh/guide/cli-reference.md Documents -i short option for --ignore-cache (ZH).
docs/en/guide/cli-reference.md Documents -i short option for --ignore-cache (EN).
config/pkg/target/curl.yml Promotes brotli/zstd to dependencies for curl builds.
config/pkg/lib/zstd.yml Adds libzstd.lib to Windows static libs.
config/pkg/lib/zlib.yml Removes hosted-binary config for zlib.
config/pkg/lib/xz.yml Removes hosted-binary config for xz.
config/pkg/lib/openssl.yml Removes hosted-binary config for openssl.
config/pkg/lib/libunistring.yml Removes hosted-binary config for libunistring.
config/pkg/lib/libssh2.yml Removes hosted-binary config for libssh2.
config/pkg/lib/libsodium.yml Removes hosted-binary config for libsodium.
config/pkg/lib/libpng.yml Removes hosted-binary config for libpng.
config/pkg/lib/libiconv.yml Removes hosted-binary config for libiconv.
config/pkg/lib/libedit.yml Removes hosted-binary config for libedit.
config/pkg/lib/libcares.yml Removes hosted-binary config for libcares.
config/pkg/lib/glfw.yml Adds macOS framework linkage metadata for glfw.
config/pkg/lib/bzip2.yml Removes hosted-binary config for bzip2.
config/pkg/lib/brotli.yml Removes hosted-binary config for brotli.
config/pkg/ext/ext-swow.yml Removes suggests entries from swow extension config.
config/pkg/ext/ext-ds.yml Switches ds extension artifact source from PECL to git extraction.
config/pkg/ext/builtin-extensions.yml Adds ext-dom dependency to ext-xmlreader.
config/artifact/ncurses.yml Removes hosted-binary config for ncurses artifact.
.github/workflows/tests.yml Refactors CI to label-gate and generate ext-test matrices via new dev commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/StaticPHP/Runtime/Shell/DefaultShell.php
Comment thread src/StaticPHP/Artifact/ArtifactExtractor.php
Comment thread src/StaticPHP/Artifact/ArtifactExtractor.php
Comment thread .github/workflows/tests.yml Outdated
Comment thread src/Package/Target/php/windows.php
Comment thread src/StaticPHP/ConsoleApplication.php
Comment thread src/Package/Target/php/unix.php Outdated
@crazywhalecc crazywhalecc requested a review from henderkes May 10, 2026 23:46
@crazywhalecc
Copy link
Copy Markdown
Owner Author

Summary of changes

CI automation

  • New CI automation commands and workflows
    • dev:gen-ext-test-matrix: Generate a balanced matrix for extension and library tests, avoiding conflicts and matrix waste, and merge extension tests
    • dev:test-bot: Analyze PR changed files and labels, call matrix generating function

Bugfix

  • Fix --retry command on API calling and git calling.
  • Remove binary: hosted temporarily.
  • Fix extension memcache,imap,xmlreader,opentemetry,swow,intl,ds,glfw,brotli,zstd build bug
  • Remove duplicate phar patch
  • Fix UnixCMakeExecutor incorrectly applying macOS frameworks on linux
  • Patch BUILD_CC using system c compiler instead of zig-cc

@henderkes
Copy link
Copy Markdown
Collaborator

I'll first see why using zig-cc leads to a crash there. Other than that looks good.

- openssl
- curl
- ext-openssl
- ext-curl
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Owner Author

@crazywhalecc crazywhalecc May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I almost forgot about this. The generating result from gen-ext-test-matrix is a little buggy for swow. Due to feature of swow, it will effect native extension's behavior. Either exclude SWOW from testing or separate it from the curl extension.

Comment thread docs/en/guide/cli-reference.md
| `--for-packages=<list>` | | 按包名下载其所需的制品 |
| `--without-suggests` | | 使用 `--for-extensions` 时跳过建议包 |
| `--clean` | | 下载前删除旧的下载缓存 |
| `--with-php=<ver>` | | PHP 版本,格式为 `major.minor`(默认 `8.4`)|
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump to 8.5 with v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-test This PR has not been tested yet, cannot merge now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants